//
//  WPMineBaseVC.m
//  wobingwoyi
//
//  Created by WGP on 16/9/8.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "WPMineBaseVC.h"

@interface WPMineBaseVC ()

@property(nonatomic,strong)UIView *titleView;
@property(nonatomic,strong)WPBtnNoHighLight *indivalBtn;
@property(nonatomic,strong)WPBtnNoHighLight *famousBtn;
@property(nonatomic,strong)UICollectionView *collectionView;

@end

@implementation WPMineBaseVC

- (void)viewDidLoad {
    [super viewDidLoad];
   
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"back_normal"] forState:UIControlStateNormal];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"back_highlight"] forState:UIControlStateHighlighted];
    [backBtn addTarget:self action:@selector(backBtnDidClick) forControlEvents:UIControlEventTouchDown];
    [backBtn sizeToFit];
    
    UIBarButtonItem *btn_left = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    
    UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]   initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace   target:nil action:nil];
    /**
     width为负数时，相当于btn向右移动width数值个像素，由于按钮本身和  边界间距为5pix，所以width设为-5时，间距正好调整为0；width为正数 时，正好相反，相当于往左移动width数值个像素
     */
    negativeSpacer.width = -8;
    self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:negativeSpacer, btn_left, nil];
    
     [self setupUI];
}

-(void)setupUI
{
    [self titleView];
    [self collectionView];
}



-(void)dealloc
{
    //    NSLog(@"疾病类型控制器死了");
}

-(void)backBtnDidClick
{
    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
